export default function(time) {
  // 获取当前时间 减去
  let now = Date.now();
  let between = now - time;
  // 将毫秒格式话
  let s = Math.floor(between / 1000);
  let m = Math.floor(s / 60);
  let h = Math.floor(m / 60);
  let d = Math.floor(h / 24);
  let M = Math.floor(d / 30);
  let Y = Math.floor(M / 24);
  if (Y >= 1) {
    return Y + "年前";
  } else if (M >= 1) {
    return M + "月前";
  } else if (d >= 1) {
    return d + "天前";
  } else if (h >= 1) {
    return h + "小时前";
  } else {
    return m + "分钟前";
  }
}
